package test.organization;

import com.cait.framework.data.DevidePageParms;
import com.cait.workflowserver.definition.Participant;
import com.cait.workflowserver.definition.ParticipantCollection;
import com.cait.workflowserver.organization.AbstractOrganizationModelReader;
import com.cait.workflowserver.organization.OrganizationModelReaderFactory;

import test.WorkFlowTest;

public class orgtest extends WorkFlowTest {

	public orgtest(String arg0) {
		super(arg0);
		// TODO Auto-generated constructor stub
	}
	
	public void testGetGor()
	{
		java.lang.StringBuffer sb=new   java.lang.StringBuffer();
		//String m="  公司:(023)3339444342223||家庭:023-13883323705::44orr";
		String m=" 67886282(公司)、67543807(集团)";
		int len=m.length();
		String t="";
		int r=0;
		for(int j=0;j<len;j++)
		{
			String s= String.valueOf(m.charAt(j));
			if(s.equals("-")||
					s.equals("+")||
					s.equals("(")||
					s.equals(")")||
					s.equals("（")||
					s.equals("）"))
				continue;
			if(s.equals("0")||
					s.equals("1")||	
					s.equals("2")||	
					s.equals("3")||	
					s.equals("4")||	
					s.equals("5")||	
					s.equals("6")||	
					s.equals("7")||	
					s.equals("8")||	
					s.equals("9"))
			{
				
				t+=s;
			}
			else
			{
				if(!t.equals(""))
				{
					if(r>0)
						sb.append(",");
					r++;
					sb.append(t);
				}
				t="";
				continue;
			}
			if(j+1==len)
			{
				if(!t.equals(""))
				{
					if(r>0)
						sb.append(",");
					r++;
					sb.append(t);
				}
				t="";
				
			}
			
		}
		
		System.out.println(sb.toString());
		
		//System.out.println(com.cait.workflowserver.runtime.Server.getInstance().getProcInstManager().getReleavantDatas("c0b72a5e-1b0d-46c8-9d48-9b75f7b1a31f").size());//.getValueByName("frequency"));
  		//AbstractOrganizationModelReader ao=OrganizationModelReaderFactory.createOrganizationModelReader();
////		String m=ao.getRootOrganizationId();
////		System.out.println(m);
////		ParticipantCollection p=ao.getChildOrganizations(m,new DevidePageParms(0,0));
////		System.out.println(((Participant)p.get(1)).getId());
////		p=ao.getChildOrganizations("f6018deb-ff87-44ac-b3d7-283d103e0b93",new DevidePageParms(0,0));
////		System.out.println(((Participant)p.get(0)).getName());
////		String s="current.procinst.actinsts.findbyactId('3324-234234234-fwesdf')";
// 		//com.cait.workflowserver.definition.ParticipantCollection p=ao.getChildRoles("bd09fdf1-ac7e-47c1-9258-163ce3870264", new DevidePageParms(0,0));
// 	//	System.out.println(p.size());
// 	//	System.out.println(((Participant)p.get(0)).getName());
// 		com.cait.workflowserver.definition.ParticipantCollection p=ao.getPersonEntityListByOrgId("03975905-9e8e-459d-aca7-53674ca50804", false, new DevidePageParms(0,0));
// 		
// 		System.out.println(p.size());
// 	 	 	System.out.println(((Participant)p.get(0)).getId()+((Participant)p.get(0)).getName());
// 		String t=ao.getParentOrgsNamePath(((com.cait.workflowserver.organization.PersonEntity)p.get(0)).getOrgId());
// 		System.out.println("组织路径:"+t);
// 		//		s=s.replaceAll("'","\"");
////		String m="current.procinst.actinsts.findbyactId(\"";
////		int sindex=s.indexOf(m);
////		int eindex=s.lastIndexOf("\"");
////		System.out.println(sindex);
////		System.out.println(eindex);
////		System.out.println(s.substring(sindex+m.length(),eindex));
//		
		
//		Participant p2=ao.getPersonEntityById("8b103dd3-cef3-4250-b222-e9420c99e29f");
//		System.out.println("打印人员信息");
//		if(p2==null)
//		{
//			System.out.println("不存在");
//		}else
//		{
//		System.out.println(p2.getId());
//		System.out.println(p2.getName());
//		}
//		com.cait.workflowserver.interactiveface.serviceface.ServiceApi sa=  com.cait.workflowserver.interactiveface.serviceface.ServiceApi.getInstance();
//		System.out.println(sa.getApplicationUrlByWorkItemId("299f3d98-660d-497a-9a90-03c36f009504"));
//		com.cait.workflowserver.definition.activitydefiniton.PermissionCollection ps=sa.getApplicationPermissionsByWorkItemId("299f3d98-660d-497a-9a90-03c36f009504");
//		com.cait.workflowserver.definition.activitydefiniton.Permission p=(com.cait.workflowserver.definition.activitydefiniton.Permission)ps.get(0);
//		com.cait.workflowserver.definition.activitydefiniton.OperatorItem o=(com.cait.workflowserver.definition.activitydefiniton.OperatorItem )p.getOperations().get(2);
//		System.out.println(p.getName()+"_"+o.getName());
//	    com.cait.workflowserver.definition.ActualParameterCollection as=sa.getApplicationActualParamsByWorkItemId("299f3d98-660d-497a-9a90-03c36f009504");
//	
//	    com.cait.workflowserver.definition.ActualParameter ap= (  com.cait.workflowserver.definition.ActualParameter )as.get(0);
//		System.out.println( ap.getName()+"_"+ap.getValueExpression());
//	   
		
	}

}
